package main

import (
	"context"

	processClipBoard "clipboard-tray/process/clipboard"
	processSetting "clipboard-tray/process/setting"
	processTray "clipboard-tray/process/tray"

	log "clipboard-tray/common/log"
)

func main() {
	logger := log.NewLogger("warn", "log.log")
	setup := processSetting.NewConfProcessor(logger)
	cfg := setup.Load()
	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()
	board := processClipBoard.NewClipBoard(ctx, cfg.Board, logger)
	tray := processTray.NewTray(board.Buffer, logger)
	go board.InitWatcher(tray.ClipBoardUpdateChan)
	tray.InitTray()
}
